﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<brjostagjof.Models.User>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	Skoða notanda
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <h2>Upplýsingar um notanda</h2>

    <table id="minarUpp2">
  <tbody>
  <tr>
     <td><img class="thumbnail2"src="/../../images/<%= ViewData["photo"] %>" alt="schoolbook" /><ul>
     <%if (Model.name != null)
       { %>
        <li> <input type="hidden" id="ID" value="<%: Model.ID %>" /></li>
        <li><b>Nafn:</b>&nbsp;<%:Model.name  %></li>
     <%} %>
     <%if (Model.SpecialistUser != null)
       {%>
       <li><b>Sérfræðigrein:</b>&nbsp;<%: Model.SpecialistUser.SpecialistCategory.name %></li>
     <%} %>
     <%if (Model.email != null)
       { %>
        <li><b>Netfang:</b>&nbsp;<%:Model.email  %></li>
     <%} %>
     <%if (Model.age != null)
       { %>
        <li><b>Aldur:</b>&nbsp;<%: Model.age %></li>
     <%} %>
     <%if (Model.gender != null && Model.gender== true)
       { %>
        <li><b>Kyn:</b> Karlkyns</li>
        <%} %>
     <%if (Model.gender != null && Model.gender== false)
       { %>
             <li><b>Kyn:</b> Kvenkyns</li>
     <%} %>
     <%if (Model.address != null)
       { %>
            <li><b>Heimilsfang:</b>&nbsp;<%: Model.address  %></li>
     <%} %>
     <%if (Model.zipCode != null)
       { %>
            <li><b>Póstnúmer:</b>&nbsp;<%:Model.zipCode  %></li>
     <%} %>
        <%if (Model.description != null)
       { %>
            <li><b>Um mig:</b></li>
            <li id="adeinsNidur2"><%:Model.description%></li>
           
     <%} %>
             <li id="adeinsNidur"><a href="#"  onclick="saveContact(<%= Model.ID %>);">&raquo;&nbsp;Bæta sem vin</a></li>
             <li id="userCommment"><a id="umsogn" style="cursor:pointer;">Umsagnir notanda: sýna/fela</a>
             <fieldset id="commentField">
        <ul id="commentList" class="commentList">
        </ul>
        <% if (Page.User.Identity.IsAuthenticated)
           { %>
        <ul class="commentList" id="commentWindow">
            
		   
	    </ul>
        <% } %>
    </fieldset>
    <script type="text/html" id="commentTemplate">
    <li class="allComments">
        <div class="commentBody">
            <a href="../../MySite/ViewUserByID/${userID}">${userName}</a>
            &nbsp;|&nbsp;${commentDate}&nbsp;|&nbsp;<a href="${url}${artyID}" class="smallerFont" style=" color:grey; font-size:8; "><b>Sjá grein</b></a><br/>
            <span>${message}</span>
        </div>
    </li>
    </script>
    <script type="text/javascript">
        $(document).ready(function () {
            GetComments();
        });
        function GetComments() {
            $.ajax({
                type: "GET",
                contentType: "application/json; charset=utf-8",
                url: "/Home/GetCommentsByUserID/" + $("#ID").val(),
                data: {},
                dataType: "json",
                success: function (n) {
                    $("#commentTemplate").tmpl(n).appendTo("#commentList");
                },
                error: function (xhr, err) {
                    alert("readyState: " + xhr.readyState + "\nstatus: " + xhr.status);
                }
            });
        }
    </script>         
             

             </li>
             </ul>
     </td>
    </tr> 
  </tbody>
  </table>

</asp:Content>
